﻿using System.Collections.Generic;

namespace YourLastOptionsDialog.ViewModels.Options
{
    /// <summary>
    /// Represents a collection of options that has been grouped by their group name.
    /// </summary>
    public class OptionGroup
    {
        /// <summary>
        /// Gets or sets the name of the group.
        /// </summary>
        public string GroupName
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the options that all share the same group name.
        /// </summary>
        public IList<Option> Options
        {
            get;
            private set;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="OptionGroup"/> class.
        /// </summary>
        /// <param name="groupName">The name of the group.</param>
        public OptionGroup(string groupName)
        {
            GroupName = groupName;
            Options = new List<Option>();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="OptionGroup"/> class.
        /// </summary>
        /// <param name="groupName">The name of the group.</param>
        /// <param name="options">The options that are assumed to all share the given group name.</param>
        public OptionGroup(string groupName, IList<Option> options)
        {
            // we do not explicitly test for valid group names here
            GroupName = groupName;
            Options = options;
        }
    }
}
